#ifndef _STEPMOTOR_H_
#define _STEPMOTOR_H_

#include "stm32f10x.h"

#define A_L  GPIOA->ODR &=~(1<<7)
#define A_H  GPIOA->ODR |= (1<<7)
#define A1_L GPIOA->ODR &=~(1<<6)
#define A1_H GPIOA->ODR |= (1<<6)
#define B_L  GPIOA->ODR &=~(1<<5)
#define B_H  GPIOA->ODR |= (1<<5)
#define B1_L GPIOA->ODR &=~(1<<4)
#define B1_H GPIOA->ODR |= (1<<4)

#define STE_1 { A_H;A1_L;B_L;B1_H; }  //1001
#define STE_2 { A_L;A1_H;B_L;B1_H; }	//0101
#define STE_3 { A_L;A1_H;B_H;B1_L; }	//0110
#define STE_4 { A_H;A1_L;B_H;B1_L; }	//1010

#define STOP { A_L;A1_L;B_L;B1_L; }	//0000

#define PAUSE 0
#define RIGHT 1
#define LEFT  2

void StepMotorPinInit(void);
void StepMotorContorl(uint8_t mode,uint8_t num);

#endif
